import { Map } from "immutable";
import * as actionTypes from "./constants";

const defaultState = Map({
  songAllStyle: [],
  songSub: [],
  songCategories: [],
  playlists: [],
});

const a = (state = defaultState, action) => {
  switch (action.type) {
    case actionTypes.GETSONGSUB:
      return state.set("songSub", action.sub);
    case actionTypes.GETSONGCATEGORIES:
      return state.set("songCategories", action.categories);
    case actionTypes.GETSONGSTYLEALL:
      return state.set("songAllStyle", action.all);
    case actionTypes.GETTOPPLAYLISTACTION:
      return state.set("playlists", action.playlists);
    default:
      return state;
  }
};
export default a;
